package com.feng.study.demo.other;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class XxljobDemo {

    @XxlJob(value = "xxljobTest")
    public ReturnT<String> xxljobTest(String param) {
        XxlJobHelper.handleSuccess("本次测试任务调度成功");

        System.out.println("=======" + param);

        ReturnT<String> returnT = new ReturnT<>();
        returnT.setCode(111);
        returnT.setMsg("success");
        returnT.setContent("hello,world!");
        return returnT;
    }
}
